#ifndef _SOFT_TIMER_H
#define _SOFT_TIMER_H


//------------------------------static type----------------------
//timer dis/enable
typedef enum
{
TimerDisable,
TimerEnable
}TimerStateType;

//timer alarm state
typedef enum
{
AlarmOff,
AlarmOn
}AlarmStateType;

//timer list type
typedef struct timer
{
	TimerStateType TimerState;
	unsigned int TimerSet;
	unsigned int TimerCnt;
	AlarmStateType AlarmState;
}SoftTimerType;

//------------------------------interface----------------------
#define TIMER_NUM 3
enum
{
TimerSys,
TimerSense,
TimerKey
};

//interface
extern SoftTimerType SoftTimerBuf[TIMER_NUM];

void SoftTimerInit(void);
void SoftTimerIntCallbackHandler(unsigned int intms);
void SoftTimerSet(SoftTimerType *,unsigned int MsSet);
void SoftTimerClean(SoftTimerType *);

#endif